package Day08_20;

public class Test_Thread01 {
    public static void main(String[] args) {
        //创建线程有两种方式
        //1.继承Thread
        MyThread myThread = new MyThread();
        myThread.setName("t1");
      //  myThread.start();
            myThread.run();
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName()+"--->"+i);
        }
    }
}
class MyThread extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println( "t1" + "--->"+i);
        }
    }
}
